import { ItemData } from "../../../resource/info/ItemData";
import { ECategory } from "../../../../../Message/Public/ECategory";
import { EColor } from "../../../../../Message/Public/EColor";
import { EProp } from "../../../../../Message/Public/EProp";
import { EDrug } from "../../../../../Message/Public/EDrug";
import { SystemSetter } from "../../system/SystemSetter";
type int = number;
//class DelegateSettingRule
    
    export  class DelegateSettingRule
    {
        

        public static getFilterFun(arg1: int): Function
        {
            return DelegateSettingRule._filterFunDic[arg1];
        }

        /* internal  */static isAll(arg1: ItemData): Boolean
        {
            return true;
        }

        /* internal  */static isPurpleEquip(arg1: ItemData): Boolean
        {
            if (arg1.category == ECategory._ECategoryEquip && arg1.color >= EColor._EColorPurple) 
            {
                return true;
            }
            return false;
        }

        /* internal  */static isPurpleProp(arg1: ItemData): Boolean
        {
            if (arg1.category == ECategory._ECategoryProp && arg1.color >= EColor._EColorPurple) 
            {
                return true;
            }
            return false;
        }

        /* internal  */static isActiveProp(arg1: ItemData): Boolean
        {
            return false;
        }

        /* internal  */static isAllProp(arg1: ItemData): Boolean
        {
            if (arg1.category == ECategory._ECategoryProp) 
            {
                return true;
            }
            return false;
        }

        /* internal  */static isPropStren(arg1: ItemData): Boolean
        {
            if (arg1.category == ECategory._ECategoryProp && arg1.type == EProp._EPropEquipStrengthenProp) 
            {
                return true;
            }
            return false;
        }

        /* internal  */static isPropTie(arg1: ItemData): Boolean
        {
            if (arg1.category == ECategory._ECategoryProp && arg1.type == EProp._EPropLingBao) 
            {
                return true;
            }
            if (arg1.itemCode == 14031019 || arg1.itemCode == 14031025) 
            {
                return true;
            }
            return false;
        }

        /* internal  */static isPropAdvance(arg1: ItemData): Boolean
        {
            if (arg1.category == ECategory._ECategoryProp && arg1.type == EProp._EPropLingBaoDaemon) 
            {
                return true;
            }
            if (arg1.itemCode == 14031139 || arg1.itemCode == 14031140) 
            {
                return true;
            }
            return false;
        }

        /* internal  */static isPropKill(arg1: ItemData): Boolean
        {
            if (arg1.category == ECategory._ECategoryProp && arg1.type == EProp._EPropKillEvilToken) 
            {
                return true;
            }
            return false;
        }

        /* internal  */static isPropSoap(arg1: ItemData): Boolean
        {
            if (arg1.category == ECategory._ECategoryProp && arg1.type == EProp._EPropSoap) 
            {
                return true;
            }
            return false;
        }

        /* internal  */static isPropGouhuo(arg1: ItemData): Boolean
        {
            if (arg1.category == ECategory._ECategoryProp && arg1.type == EProp._EPropFireWood) 
            {
                return true;
            }
            if (arg1.category == ECategory._ECategoryDrug && arg1.type == EDrug._EDrugGuildFlameWine) 
            {
                return true;
            }
            return false;
        }

        /* internal  */static isPropChange(arg1: ItemData): Boolean
        {
            if (arg1.category == ECategory._ECategoryDrug && arg1.type == EDrug._EDrugChangeShape) 
            {
                return true;
            }
            return false;
        }

        /* internal  */static isJewel(arg1: ItemData): Boolean
        {
            if (arg1.category == ECategory._ECategoryJewel) 
            {
                return true;
            }
            return false;
        }

        /* internal  */static isIllustrate(arg1: ItemData): Boolean
        {
            if (arg1.category == ECategory._ECategoryIllustrate) 
            {
                return true;
            }
            return false;
        }

        public static isProp(arg1: int): Boolean
        {
            return arg1 >= 11 && arg1 <= 20;
        }

        public static isGettingItem(arg1: ItemData): Boolean
        {
            var loc2=0;
            var loc1=SystemSetter.localSetter.delegateSetting;
            loc2 = 0;
            while (loc2 < loc1.length) 
            {
                if (DelegateSettingRule.isSuitItem(loc1[loc2], arg1)) 
                {
                    return true;
                }
                ++loc2;
            }
            return false;
        }

        public static isSuitItem(arg1: int, arg2: ItemData): Boolean
        {
            var loc1=DelegateSettingRule.getFilterFun(arg1);
            if (loc1 != null) 
            {
                return loc1.call(null, arg2);
            }
            return false;
        }

        public static /* const */ALL: int=1;

        public static /* const */PurpleEquip: int=2;

        public static /* const */PurpleProp: int=3;

        public static /* const */ActiveProp: int=4;

        public static /* const */AllProp: int=10;

        public static /* const */PropStren: int=11;

        public static /* const */PropTie: int=12;

        public static /* const */PropAdvance: int=13;

        public static /* const */PropKill: int=14;

        public static /* const */PropSoap: int=15;

        public static /* const */PropGouhuo: int=16;

        public static /* const */PropChange: int=17;

        public static /* const */Jewel: int=18;

        public static /* const */Illustrate: int=19;

        /* internal */ static /* const */_filterFunDic: Object={"1": DelegateSettingRule.isAll, "2": DelegateSettingRule.isPurpleEquip, "3": DelegateSettingRule.isPurpleProp, "4": DelegateSettingRule.isActiveProp, "11": DelegateSettingRule.isPropStren, "12": DelegateSettingRule.isPropTie, "13": DelegateSettingRule.isPropAdvance, "14": DelegateSettingRule.isPropKill, "15": DelegateSettingRule.isPropSoap, "16": DelegateSettingRule.isPropGouhuo, "17": DelegateSettingRule.isPropChange, "18": DelegateSettingRule.isJewel, "19": DelegateSettingRule.isIllustrate};
    }
